<%@page import="org.yate.oa.utils.Constants"%>
<%@page import="org.yate.oa.model.LoginEntity"%>
<%@page import="java.text.SimpleDateFormat, java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set value="${pageContext.request.contextPath}" var="ctx" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
	LoginEntity le = (LoginEntity) session.getAttribute(Constants.SESSION_USER_ENTITY);
%>
<title>浏览绩效</title>
<link href="${ctx}/css/skin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/js/backOffice.js"></script>
<script type="text/javascript">
	var pid;
	var from;
	$(document).ready(function() {
		init();
	});

	function getQueryString(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
		var r = window.location.search.substr(1).match(reg);
		if (r != null)
			return unescape(r[2]);
		return null;
	}

	function init() {
		pid = getQueryString("pid");
		from = getQueryString("from");
		loadPerformanceInfo();
	}

	function loadPerformanceInfo() {
		var obj = {};
		obj.type = "getpbyid";
		obj.pid = pid;
		$.ajax({
			type : 'post',
			dataType : 'json',
			data : obj,
			url : '${ctx}/performance/post',
			success : function(data) {
				if (data.code == 200) {
					$("#performanceName").text(data.pe.partName);
					var beginPeriod = new Date(data.pe.beginPeriod);
					var endPeriod = new Date(data.pe.endPeriod);
					$("#spanCycle").html(
							beginPeriod.getFullYear() + "年"
									+ (beginPeriod.getMonth() + 1) + "月"
									+ beginPeriod.getDate() + "日 至 "
									+ endPeriod.getFullYear() + "年"
									+ (endPeriod.getMonth() + 1) + "月"
									+ endPeriod.getDate() + "日");
					$("#spanTargetUserName").text(data.target.trueName);
					$("#spanCreaterName").text(data.creater.trueName);
					var rows = data.parts;
					var str = '';
					var zpTotal = 0, kpTotal = 0, zgTotal = 0;
					for ( var i = 0; i < rows.length; i++) {
						zpTotal += parseFloat(rows[i].selfScore);
						kpTotal += parseFloat(rows[i].leaderScore);
						zgTotal += parseFloat(rows[i].managerScore);
						if (i < 5) {
							$($("td[name=tdZP]").get(i))
									.text(rows[i].selfScore);
							$($("td[name=tdKP]").get(i)).text(
									rows[i].leaderScore);
							$($("td[name=tdZGKP]").get(i)).text(
									rows[i].managerScore);
							$($("td[name=tdRemark]").get(i)).text(rows[i].des);
							continue;
						}
						if (i == 5) {
							str += '<tr><td>' + (i + 1) + '</td>'
									+ '<td rowspan="' + (rows.length - 5)
									+ '">定量70%</td>' + '<td>'
									+ rows[i].partName + '</td>' + '<td>'
									+ rows[i].partScore + '</td>' + '<td>'
									+ rows[i].partWeight + '</td>' + '<td>'
									+ rows[i].partDes + '</td>' + '<td>'
									+ rows[i].partStandard + '</td>' + '<td>'
									+ rows[i].selfScore + '</td>' + '<td>'
									+ rows[i].leaderScore + '</td>' + '<td>'
									+ rows[i].managerScore + '</td>' + '<td>'
									+ rows[i].des + '</td>';
						} else {
							str += '<tr><td>' + (i + 1) + '</td>' + '<td>'
									+ rows[i].partName + '</td>' + '<td>'
									+ rows[i].partScore + '</td>' + '<td>'
									+ rows[i].partWeight + '</td>' + '<td>'
									+ rows[i].partDes + '</td>' + '<td>'
									+ rows[i].partStandard + '</td>' + '<td>'
									+ rows[i].selfScore + '</td>' + '<td>'
									+ rows[i].leaderScore + '</td>' + '<td>'
									+ rows[i].managerScore + '</td>' + '<td>'
									+ rows[i].des + '</td>';
						}
					}
					$("#tbodyParts").append(str);
					$("#spanSelfTotal").text(parseFloat(zpTotal).toFixed(1));
					$("#spanLeaderTotal").text(parseFloat(kpTotal).toFixed(1));
					$("#spanManagerTotal").text(parseFloat(zgTotal).toFixed(1));
				}
			}
		});
	}

	function backTo() {
		if (from == "m") {
			location.href = "m-performance-list.jsp";
		} else if (from == "nm") {
			location.href = "performance-list.jsp";
		} else if (from == "zl") {
			location.href = "zl-performance-list.jsp";
		}
	}
</script>
</head>
<body>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="17" height="29" valign="top"
				background="${ctx}/images/mail_leftbg.gif"><img
				src="${ctx}/images/left-top-right.gif" width="17" height="29" /></td>
			<td width="" height="29" valign="top"
				background="${ctx}/images/content-bg.gif"><table width="100%"
					height="31" border="0" cellpadding="0" cellspacing="0"
					class="left_topbg" id="table2">
					<tr>
						<td height="31"><div class="titlebt">绩效浏览</div></td>
					</tr>
				</table></td>
			<td width="16" valign="top"
				background="${ctx}/images/mail_rightbg.gif"><img
				src="${ctx}/images/nav-right-bg.gif" width="16" height="29" /></td>
		</tr>
		<tr>
			<td height="71" valign="middle"
				background="${ctx}/images/mail_leftbg.gif">&nbsp;</td>
			<td valign="top" bgcolor="#F7F8F9"><table width="100%"
					height="138" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td height="13" valign="top">&nbsp;</td>
					</tr>
					<tr>
						<td valign="top"><table width="98%" border="0" align="center"
								cellpadding="0" cellspacing="0">
								<tr>
									<td class="left_txt">当前位置：绩效浏览</td>
								</tr>
								<tr>
									<td height="20"><table width="100%" height="1" border="0"
											cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
											<tr>
												<td></td>
											</tr>
										</table></td>
								</tr>
								<tr>
									<td><table width="100%" height="55" border="0"
											cellpadding="0" cellspacing="0">
											<tr>
												<td width="10%" height="55" valign="middle"><img
													src="${ctx}/images/title.gif" width="54" height="55"></td>
												<td width="90%" valign="top"><span class="left_txt2">
														说明：<br>
														考核分为员工自评、直接上级测评、中心负责人终评流程；扣分加分项目必须明确理由，否则视为无效。
														100分制考核；考核系数：105分以上，考核系数1.2;100以上-105，考核系数1.1；100-95分，考核系数1；95-90分，考核系数0.8；90-80分，考核系数0.5,；80分以下，考核系数0；如常态化负责本岗位之外的其他工作，根据工作重要程度及工作量大小可适当增加5-10分附加分
												</span></td>
											</tr>
										</table></td>
								</tr>
								<tr>
									<td>&nbsp;</td>
								</tr>
								<tr>
									<td><table width="100%" height="31" border="0"
											cellpadding="0" cellspacing="0" class="nowtable">
											<tr>
												<td class="left_bt2" align="middle">
													<h1 id="performanceName"></h1>
												</td>
											</tr>
										</table></td>
								</tr>
								<tr>
									<td width="100px;" valign="top"
										style="min-height: 350px; height: 350px;">
										<%
											LoginEntity user = (LoginEntity) session.getAttribute("user");
										%>
										<table class="tblPerformance" cellpadding="0" cellspacing="0">
											<tr>
												<td colspan="11" align="middle">考核周期： <span
													id="spanCycle"></span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 被考核人：<span
													id="spanTargetUserName"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													考核人：<span id="spanCreaterName"></span>
												</td>
											</tr>
											<tr>
												<td width="5%">序号</td>
												<td colspan="2">考核项目</td>
												<td width="5%">分值</td>
												<td width="5%">权重%</td>
												<td>指标描述</td>
												<td>评价标准</td>
												<td width="5%">自评</td>
												<td width="7%">考评结果</td>
												<td width="7%">主管考评</td>
												<td>备注</td>
											</tr>
											<tbody id="tbodyParts">
												<tr>
													<td>1</td>
													<td rowspan="5">定性30%</td>
													<td width="">工作操守</td>
													<td>100</td>
													<td>8</td>
													<td>
														<ul>
															<li>1.具备该岗位职业操守，遵守保密义务，并积极宣传正面信息；</li>
															<li>2.处理事情，客观公正，公私分明；</li>
															<li>3.具备诚信的价值观，诚实工作，不弄虚作假；</li>
															<li>4.未遵守以上职业操守，给公司造成负面影响，给其他同事造成困扰；</li>
															<li>5.以身作则，积极宣传正面信息，起表帅作用有具体事例可做优秀典型；</li>
														</ul>
													</td>
													<td>
														<ul>
															<li>1.符合1-3，不加分不扣分，得10分；</li>
															<li>2.符合标准4，此项0分；</li>
															<li>3.符合5，+5分，得15分；</li>
														</ul>
													</td>
													<td name="tdZP"></td>
													<td name="tdKP"></td>
													<td name="tdZGKP"></td>
													<td name="tdRemark"></td>
												</tr>
												<tr>
													<td>2</td>
													<td>工作态度</td>
													<td>100</td>
													<td>6</td>
													<td>
														<ul>
															<li>1.不推卸，能够按时完成本岗位工作；</li>
															<li>2.不服从工作分配、顶撞领导、消极怠工；</li>
															<li>3.工作时间内利用公司资源做与工作无关的事；</li>
															<li>4.热爱本职工作，有较强的工作进取心，积极配合领导及同事完成各项工作，起表帅作用有具体事例可做优秀典型；</li>
														</ul>
													</td>
													<td>
														<ul>
															<li>1.符合1，不加分不扣分，得10分；</li>
															<li>2.符合2-3，此项0分；</li>
															<li>3.符合4，+5分,得15分；</li>
														</ul>
													</td>
													<td name="tdZP"></td>
													<td name="tdKP"></td>
													<td name="tdZGKP"></td>
													<td name="tdRemark"></td>
												</tr>
												<tr>
													<td>3</td>
													<td>团队意识</td>
													<td>100</td>
													<td>4</td>
													<td>
														<ul>
															<li>1.具有集体荣誉感，团结合作，积极参与部门工作建设；</li>
															<li>2.以自我为中心，不能融入集体和团队，挑拨员工间关系；</li>
															<li>3.因个人原因致使部门整体评价下降；</li>
															<li>4.为实现部门任务目标或部门整体表扬作出突出贡献；</li>
														</ul>
													</td>
													<td>
														<ul>
															<li>1.符合1，不加分不扣分，得10分；</li>
															<li>2.符合2-3，此项0分；</li>
															<li>3.符合4，+5分,得15分；</li>
														</ul>
													</td>
													<td name="tdZP"></td>
													<td name="tdKP"></td>
													<td name="tdZGKP"></td>
													<td name="tdRemark"></td>
												</tr>
												<tr>
													<td>4</td>
													<td>部门协作</td>
													<td>100</td>
													<td>6</td>
													<td>
														<ul>
															<li>1.配合本部门及其他部门同事完成工作需求；</li>
															<li>2.在处理问题时与同事发生冲突；</li>
															<li>3.在领导发现问题制止或劝解时拒不执行；</li>
															<li>4.被服务对象投诉，并经查实；</li>
															<li>5.处理同事问题时积极、主动、热情并得到同事表扬；</li>
														</ul>
													</td>
													<td>
														<ul>
															<li>1.符合1，不加分不扣分，得10分；</li>
															<li>2.符合2-4，此项0分；</li>
															<li>3.符合5，+5分,得15分；</li>
														</ul>
													</td>
													<td name="tdZP"></td>
													<td name="tdKP"></td>
													<td name="tdZGKP"></td>
													<td name="tdRemark"></td>
												</tr>
												<tr>
													<td>5</td>
													<td>企业文化</td>
													<td>100</td>
													<td>6</td>
													<td>
														<ul>
															<li>1.遵守公司规章制度；积极参加公司各项活动；</li>
															<li>2.逃避、抵触、推诿参加公司活动；</li>
															<li>3.热爱公司，为公司、部门发展作出重大贡献或提出建设性合理化建议被采纳；</li>
														</ul>
													</td>
													<td>
														<ul>
															<li>1.符合1，不加分不扣分，得10分；</li>
															<li>2.符合2，此项0分；</li>
															<li>3.符合3，+5分,得15分；</li>
														</ul>
													</td>
													<td name="tdZP"></td>
													<td name="tdKP"></td>
													<td name="tdZGKP"></td>
													<td name="tdRemark"></td>
												</tr>
											</tbody>
											<tfoot>
												<tr>
													<td colspan="7">总分</td>
													<td><span id="spanSelfTotal"></span></td>
													<td><span id="spanLeaderTotal"></span></td>
													<td><span id="spanManagerTotal"></span></td>
													<td></td>
												</tr>
												<tr>
													<td colspan="11"><input id="btnCreate" type="button"
														value="返回绩效列表" onclick="javascript:backTo()" /> <img
														src="${ctx }/images/wait.gif" id="createWait"
														style="display: none;" /></td>
												</tr>
											</tfoot>
										</table>
									</td>
								</tr>
							</table></td>
					</tr>
				</table></td>
			<td background="${ctx}/images/mail_rightbg.gif">&nbsp;</td>
		</tr>
		<tr>
			<td valign="middle" background="${ctx}/images/mail_leftbg.gif"><img
				src="${ctx}/images/buttom_left2.gif" width="17" height="17" /></td>
			<td height="17" valign="top"
				background="${ctx}/images/buttom_bgs.gif"><img
				src="${ctx}/images/buttom_bgs.gif" width="17" height="17" /></td>
			<td background="${ctx}/images/mail_rightbg.gif"><img
				src="${ctx}/images/buttom_right2.gif" width="16" height="17" /></td>
		</tr>
	</table>
</body>
</html>